home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / how_t000.swf / scripts / DefineSprite_572 / frame_1 / DoAction.as
Encoding:
Text File  |  2010-11-09  |  9.2 KB  |  446 lines

  1. function MixCup()
  2. {
  3.    mixCup.onPress = function()
  4.    {
  5.       this.swapDepths(dpts);
  6.       startDrag(this,0);
  7.       ins4._visible = false;
  8.    };
  9.    mixCup.onRelease = function()
  10.    {
  11.       if(pan.hitTest(this))
  12.       {
  13.          stopDrag();
  14.          this.gotoAndPlay(2);
  15.          this._x = -112.6;
  16.          this._y = 78;
  17.          dpts++;
  18.       }
  19.    };
  20. }
  21. function Knief()
  22. {
  23.    knief.onPress = function()
  24.    {
  25.       this.swapDepths(dpts);
  26.       startDrag(this,0);
  27.    };
  28.    knief.onRelease = function()
  29.    {
  30.       if(cutter.hitTest(this) && cutColiFlower.hitTest(this))
  31.       {
  32.          if(_global.dd == 0)
  33.          {
  34.             this._visible = false;
  35.             cutColiFlower.gotoAndPlay(2);
  36.             dpts++;
  37.          }
  38.       }
  39.       if(cutter.hitTest(this) && cutOnion.hitTest(this))
  40.       {
  41.          if(_global.dd == 1)
  42.          {
  43.             this._visible = false;
  44.             cutOnion.gotoAndPlay(2);
  45.             dpts++;
  46.          }
  47.       }
  48.       if(cutter.hitTest(this) && cutCelery.hitTest(this))
  49.       {
  50.          if(_global.dd == 2)
  51.          {
  52.             this._visible = false;
  53.             cutCelery.gotoAndPlay(2);
  54.             dpts++;
  55.          }
  56.       }
  57.    };
  58. }
  59. stop();
  60. _root.ggt._visible = true;
  61. mixCup._visible = false;
  62. pan.forzen._visible = false;
  63. cooker._visible = false;
  64. mixer._visible = false;
  65. coliFlower.flr._visible = false;
  66. onionPlate.flr._visible = false;
  67. celeryPlate.flr._visible = false;
  68. var dpts = 10;
  69. var r = 1;
  70. var i = 2;
  71. while(i <= 20)
  72. {
  73.    eval("ins" + i)._visible = false;
  74.    i++;
  75. }
  76. bridge.onPress = function()
  77. {
  78.    this.swapDepths(dpts);
  79.    bridge.gotoAndPlay(2);
  80.    ins1._visible = false;
  81.    delete bridge.onPress;
  82.    dpts++;
  83. };
  84. var tun = 0;
  85. _global.Tunner = function()
  86. {
  87.    stove.tunner1.onPress = function()
  88.    {
  89.       ins3._visible = false;
  90.       stove.tunner._rotation += 30;
  91.       if(tun == 2)
  92.       {
  93.          stove.tunner1.enabled = false;
  94.          pan.forzen._visible = true;
  95.          pan.forzen.gotoAndPlay(2);
  96.          ins4._visible = true;
  97.          MixCup();
  98.       }
  99.       tun++;
  100.    };
  101. };
  102. _global.dd = 0;
  103. _global.TweenFun = function(posx, posy, obj)
  104. {
  105.    var _loc2_ = new mx.transitions.Tween(obj,"_x",mx.transitions.easing.Strong.easeOut,obj._x,posx,0.5,true);
  106.    _loc2_ = new mx.transitions.Tween(obj,"_y",mx.transitions.easing.Strong.easeOut,obj._y,posy,0.5,true);
  107.    _loc2_.onMotionFinished = function()
  108.    {
  109.       r = 1;
  110.    };
  111. };
  112. _global.CutColiFlower = function()
  113. {
  114.    cutColiFlower.onPress = function()
  115.    {
  116.       ins5._visible = false;
  117.       if(r == 1)
  118.       {
  119.          this.swapDepths(dpts);
  120.          startDrag(this,1);
  121.          r = 0;
  122.       }
  123.    };
  124.    cutColiFlower.onRelease = function()
  125.    {
  126.       if(cutter.hitTest(this))
  127.       {
  128.          stopDrag();
  129.          TweenFun(26,119,this);
  130.          knief.enabled = true;
  131.          Knief();
  132.          dpts++;
  133.       }
  134.       else if(cPlate.hitTest(this))
  135.       {
  136.          stopDrag();
  137.          TweenFun(-62,-119,this);
  138.          knief.enabled = false;
  139.       }
  140.    };
  141. };
  142. _global.CutOnion = function()
  143. {
  144.    cutOnion.onPress = function()
  145.    {
  146.       ins6._visible = false;
  147.       if(r == 1)
  148.       {
  149.          this.swapDepths(dpts);
  150.          startDrag(this,0);
  151.          r = 0;
  152.       }
  153.    };
  154.    cutOnion.onRelease = function()
  155.    {
  156.       if(cutter.hitTest(this))
  157.       {
  158.          stopDrag();
  159.          TweenFun(26,119,this);
  160.          knief.enabled = true;
  161.          Knief();
  162.          dpts++;
  163.       }
  164.       else if(oPlate.hitTest(this))
  165.       {
  166.          stopDrag();
  167.          TweenFun(-122.7,-118.8,this);
  168.          knief.enabled = false;
  169.       }
  170.    };
  171. };
  172. _global.CutCelery = function()
  173. {
  174.    cutCelery.onPress = function()
  175.    {
  176.       ins7._visible = false;
  177.       if(r == 1)
  178.       {
  179.          this.swapDepths(dpts);
  180.          startDrag(this,0);
  181.          r = 0;
  182.       }
  183.    };
  184.    cutCelery.onRelease = function()
  185.    {
  186.       if(cutter.hitTest(this))
  187.       {
  188.          stopDrag();
  189.          TweenFun(26,119,this);
  190.          knief.enabled = true;
  191.          Knief();
  192.          dpts++;
  193.       }
  194.       else if(celPlate.hitTest(this))
  195.       {
  196.          stopDrag();
  197.          TweenFun(3,-113.8,this);
  198.          knief.enabled = false;
  199.       }
  200.    };
  201. };
  202. _global.Bowl = function()
  203. {
  204.    bowl.onPress = function()
  205.    {
  206.       ins8._visible = false;
  207.       cutter._visible = false;
  208.       this.swapDepths(dpts);
  209.       startDrag(this,1);
  210.    };
  211.    bowl.onRelease = function()
  212.    {
  213.       if(hitbwl.hitTest(this))
  214.       {
  215.          stopDrag();
  216.          TweenFun(35,100,this);
  217.          this._width = 82.7;
  218.          this._height = 61.7;
  219.          cutColiFlower._visible = false;
  220.          cutOnion._visible = false;
  221.          cutCelery._visible = false;
  222.          coliFlower.flr._visible = true;
  223.          onionPlate.flr._visible = true;
  224.          celeryPlate.flr._visible = true;
  225.          ins9._visible = true;
  226.          delete bowl.onPress;
  227.          delete bowl.onRelease;
  228.          ColiFlower();
  229.          dpts++;
  230.       }
  231.    };
  232. };
  233. _global.ColiFlower = function()
  234. {
  235.    coliFlower.onPress = function()
  236.    {
  237.       this.swapDepths(dpts);
  238.       startDrag(this,0);
  239.       ins9._visible = false;
  240.    };
  241.    coliFlower.onRelease = function()
  242.    {
  243.       if(bowl.hitTest(this))
  244.       {
  245.          stopDrag();
  246.          this._x = -91.3;
  247.          this._y = 45.6;
  248.          this.gotoAndPlay(2);
  249.          dpts++;
  250.       }
  251.    };
  252. };
  253. _global.OnionPlate = function()
  254. {
  255.    onionPlate.onPress = function()
  256.    {
  257.       ins10._visible = false;
  258.       this.swapDepths(dpts);
  259.       startDrag(this,0);
  260.    };
  261.    onionPlate.onRelease = function()
  262.    {
  263.       if(bowl.hitTest(this))
  264.       {
  265.          stopDrag();
  266.          this._x = -92.8;
  267.          this._y = 45;
  268.          this.gotoAndPlay(2);
  269.          dpts++;
  270.       }
  271.    };
  272. };
  273. _global.CeleryPlate = function()
  274. {
  275.    celeryPlate.onPress = function()
  276.    {
  277.       this.swapDepths(dpts);
  278.       startDrag(this,0);
  279.       ins11._visible = false;
  280.    };
  281.    celeryPlate.onRelease = function()
  282.    {
  283.       if(bowl.hitTest(this))
  284.       {
  285.          stopDrag();
  286.          this._x = -100;
  287.          this._y = 41;
  288.          this.gotoAndPlay(2);
  289.          dpts++;
  290.       }
  291.    };
  292. };
  293. _global.MusterPlate = function()
  294. {
  295.    muster.onPress = function()
  296.    {
  297.       this.swapDepths(dpts);
  298.       startDrag(this,0);
  299.       ins16._visible = false;
  300.    };
  301.    muster.onRelease = function()
  302.    {
  303.       if(bowl.hitTest(this))
  304.       {
  305.          stopDrag();
  306.          this._x = 65;
  307.          this._y = 82;
  308.          this.gotoAndPlay(2);
  309.          dpts++;
  310.       }
  311.    };
  312. };
  313. _global.Salt = function()
  314. {
  315.    salt.onPress = function()
  316.    {
  317.       this.swapDepths(dpts);
  318.       startDrag(this,0);
  319.       ins12._visible = false;
  320.    };
  321.    salt.onRelease = function()
  322.    {
  323.       if(bowl.hitTest(this))
  324.       {
  325.          stopDrag();
  326.          this._x = -20.6;
  327.          this._y = -70.5;
  328.          this.gotoAndPlay(2);
  329.          dpts++;
  330.       }
  331.    };
  332. };
  333. _global.Pepper = function()
  334. {
  335.    pepper.onPress = function()
  336.    {
  337.       this.swapDepths(dpts);
  338.       startDrag(this,0);
  339.       ins13._visible = false;
  340.    };
  341.    pepper.onRelease = function()
  342.    {
  343.       if(bowl.hitTest(this))
  344.       {
  345.          stopDrag();
  346.          this._x = 9.5;
  347.          this._y = -88.6;
  348.          this.gotoAndPlay(2);
  349.          dpts++;
  350.       }
  351.    };
  352. };
  353. _global.SourCream = function()
  354. {
  355.    sourCream.onPress = function()
  356.    {
  357.       this.swapDepths(dpts);
  358.       startDrag(this,0);
  359.       ins14._visible = false;
  360.    };
  361.    sourCream.onRelease = function()
  362.    {
  363.       if(bowl.hitTest(this))
  364.       {
  365.          stopDrag();
  366.          this.gotoAndPlay(2);
  367.          this._x = 92;
  368.          this._y = 98.5;
  369.          dpts++;
  370.       }
  371.    };
  372. };
  373. _global.SaladOil = function()
  374. {
  375.    saladOil.onPress = function()
  376.    {
  377.       this.swapDepths(dpts);
  378.       startDrag(this,0);
  379.       ins15._visible = false;
  380.    };
  381.    saladOil.onRelease = function()
  382.    {
  383.       if(bowl.hitTest(this))
  384.       {
  385.          stopDrag();
  386.          this._x = 84;
  387.          this._y = 109.5;
  388.          this.gotoAndPlay(2);
  389.          dpts++;
  390.       }
  391.    };
  392. };
  393. _global.Cooker = function()
  394. {
  395.    cooker.onPress = function()
  396.    {
  397.       this.swapDepths(dpts);
  398.       startDrag(this,0);
  399.       ins17._visible = false;
  400.       mixCup.nextFrame();
  401.    };
  402.    cooker.onRelease = function()
  403.    {
  404.       if(bowl.hitTest(this))
  405.       {
  406.          stopDrag();
  407.          this._x = 85.7;
  408.          this._y = 99.5;
  409.          this.gotoAndPlay(2);
  410.          dpts++;
  411.       }
  412.    };
  413. };
  414. _global.Spoon = function()
  415. {
  416.    spoon.onPress = function()
  417.    {
  418.       this.swapDepths(dpts);
  419.       startDrag(this,0);
  420.       ins18._visible = false;
  421.    };
  422.    spoon.onRelease = function()
  423.    {
  424.       if(bowl.hitTest(this))
  425.       {
  426.          stopDrag();
  427.          this._visible = false;
  428.          pan._visible = false;
  429.          bowl._visible = false;
  430.          coliFlower._visible = false;
  431.          onionPlate._visible = false;
  432.          celeryPlate._visible = false;
  433.          muster._visible = false;
  434.          stove._visible = false;
  435.          cooker._visible = false;
  436.          salt.nextFrame();
  437.          pepper.nextFrame();
  438.          sourCream.nextFrame();
  439.          saladOil.nextFrame();
  440.          mixer._visible = true;
  441.          mixer.gotoAndPlay(2);
  442.          dpts++;
  443.       }
  444.    };
  445. };
  446.